package com.perform.mapper.user;

import com.domain.entity.User;
import com.encrypt.MyMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用户 mybatis 映射文件
 * @author c-fanqj
 * @date 2022/8/23
 * @apiNote
 */
//@Mapper
public interface IUserMapper extends MyMapper<User> {

    @Select("select * from user where id = #{id}")
    User findUserById(Integer id);

    @Select("select * from user")
    List<User> findAllUsers();

    @Insert("INSERT INTO user(userName, passWord, realName) VALUES(#{userName}, #{passWord}, #{realName})")
    int insertUser(User user);

}
